import pickle

prime = list(range(3, 1000, 2))

l = len(prime)
flag = 0

while prime[flag] ** 2 < 1000:
#     print l,prime[flag]            
    prime = list(filter(lambda x:x % prime[flag] != 0 or x == prime[flag], prime))
    l = len(prime)
    flag += 1

prime.append(2)
prime.sort()
F = open('prime100.txt', 'wb')
pickle.dump(prime, F)
F.close()

